﻿/**
 * Copyright (C) 2013 original author and authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NGuice.Inject.Spi;
using System.Reflection;
using AopAlliance.Intercept;

namespace NGuice.Inject.Internal
{
    /// <summary>
    /// 为T类型的构造器调用的代理
    /// </summary>
    /// <typeparam name="T"></typeparam>
    internal interface ConstructionProxy<T>
    {
        /// <summary>
        /// 使用给定参数构造实例T
        /// </summary>
        /// <param name="arguments"></param>
        /// <returns></returns>
        /// <exception cref="TargetInvocationException"></exception>
        T NewInstance(params object[] arguments);

        /// <summary>
        /// 返回此构造器的注入点
        /// </summary>
        InjectionPoint InjectionPoint
        {
            get;
        }

        /// <summary>
        /// 返回注入的构造器。如果注入的构造器是合成的（例如为方法拦截生成的代码），则返回固有的构造器
        /// </summary>
        ConstructorInfo Constructor
        {
            get;
        }

        /*if[AOP]*/
        /// <summary>
        /// 按照调用顺序获取应用到每个方法的拦截器
        /// </summary>
        IDictionary<MethodInfo, IList<IMethodInterceptor>> MethodInterceptors
        {
            get;
        }
        /*end[AOP]*/
    }
}
